#!/bin/bash
du -sh /backup/* >/tmp/bak.log
for dir in `ls /backup/`
do
	if [ -f /backup/$dir/${dir}_flag_$(date +%F) ];then
		echo "$dir backup OK" >> /tmp/result_$(date +%F).log
	else
		echo "$dir backup fail" >> /tmp/result_$(date +%F).log
	fi
done

[ -f /tmp/result_$(date +%F).log ] && mail -s "$(date +%F) server back" 851628816@qq.com </tmp/result_$(date +%F).log


